{% load i18n %} {% load markup %} {% with index=request.path|slice:':-1'|split:'/'|slice:':-1'|join:'/' %} {% if object.pk and object.get_absolute_url %} {% trans "Cancel" %} {% else %} {% trans "Cancel" %} {% endif %} {% endwith %}